home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / swingall.jar / javax / swing / plaf / basic / BasicTextUI$UpdateHandler.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-07-15  |  1.7 KB  |  51 lines

  1. package javax.swing.plaf.basic;
  2.  
  3. import java.awt.Rectangle;
  4. import java.beans.PropertyChangeEvent;
  5. import java.beans.PropertyChangeListener;
  6. import javax.swing.event.DocumentEvent;
  7. import javax.swing.event.DocumentListener;
  8. import javax.swing.text.Document;
  9.  
  10. class BasicTextUI$UpdateHandler implements PropertyChangeListener, DocumentListener {
  11.    // $FF: synthetic field
  12.    private final BasicTextUI this$0;
  13.  
  14.    BasicTextUI$UpdateHandler(BasicTextUI var1) {
  15.       this.this$0 = var1;
  16.    }
  17.  
  18.    public final void changedUpdate(DocumentEvent var1) {
  19.       Rectangle var2 = this.this$0.painted ? this.this$0.getVisibleEditorRect() : null;
  20.       this.this$0.rootView.changedUpdate(var1, var2, this.this$0.rootView.getViewFactory());
  21.    }
  22.  
  23.    public final void insertUpdate(DocumentEvent var1) {
  24.       Rectangle var2 = this.this$0.painted ? this.this$0.getVisibleEditorRect() : null;
  25.       this.this$0.rootView.insertUpdate(var1, var2, this.this$0.rootView.getViewFactory());
  26.    }
  27.  
  28.    public final void propertyChange(PropertyChangeEvent var1) {
  29.       Object var2 = var1.getOldValue();
  30.       Object var3 = var1.getNewValue();
  31.       if (var2 instanceof Document || var3 instanceof Document) {
  32.          if (var2 != null) {
  33.             ((Document)var2).removeDocumentListener(this);
  34.          }
  35.  
  36.          if (var3 != null) {
  37.             ((Document)var3).addDocumentListener(this);
  38.          }
  39.  
  40.          this.this$0.modelChanged();
  41.       }
  42.  
  43.       this.this$0.propertyChange(var1);
  44.    }
  45.  
  46.    public final void removeUpdate(DocumentEvent var1) {
  47.       Rectangle var2 = this.this$0.painted ? this.this$0.getVisibleEditorRect() : null;
  48.       this.this$0.rootView.removeUpdate(var1, var2, this.this$0.rootView.getViewFactory());
  49.    }
  50. }
  51.